# coding:utf-8
from selenium import webdriver


driver = webdriver.Chrome()
driver.get("http://bj.ganji.com/")
driver.implicitly_wait(3)

h = driver.current_window_handle
print(h)

driver.find_element_by_link_text("高薪工作").click()
all_h = driver.window_handles
print(all_h)
driver.switch_to.window(all_h[1])
print(driver.title)
driver.close()
driver.switch_to.window(h)
print(driver.title)
